# DocType Mapper, Sales Order-Receivable Voucher
[

	# These values are common in all dictionaries
	{
		'creation': '2010-08-08 17:09:36',
		'docstatus': 0,
		'modified': '2011-09-15 15:04:45',
		'modified_by': 'Administrator',
		'owner': 'Administrator'
	},

	# These values are common for all Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'name': '__common__',
		'parent': 'Sales Order-Receivable Voucher',
		'parentfield': 'table_mapper_details',
		'parenttype': 'DocType Mapper'
	},

	# These values are common for all Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'name': '__common__',
		'parent': 'Sales Order-Receivable Voucher',
		'parentfield': 'field_mapper_details',
		'parenttype': 'DocType Mapper'
	},

	# These values are common for all DocType Mapper
	{
		'doctype': u'DocType Mapper',
		'from_doctype': 'Sales Order',
		'module': 'Accounts',
		'name': '__common__',
		'ref_doc_submitted': 1,
		'to_doctype': 'Receivable Voucher'
	},

	# DocType Mapper, Sales Order-Receivable Voucher
	{
		'doctype': u'DocType Mapper',
		'name': 'Sales Order-Receivable Voucher'
	},

	# Field Mapper Detail
	{
		'checking_operator': '=',
		'doctype': 'Field Mapper Detail',
		'from_field': 'customer',
		'map': 'Yes',
		'match_id': 0,
		'to_field': 'customer'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval: obj.basic_rate and (flt(obj.amount) - flt(obj.billed_amt))/flt(obj.basic_rate) or obj.qty',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'qty'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'parent',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'sales_order'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'name',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'so_detail'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval:flt(obj.amount) - flt(obj.billed_amt)',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'amount'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval: (flt(obj.amount) - flt(obj.billed_amt))* flt(obj.export_rate)/flt(obj.basic_rate)',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'export_amount'
	},

	# Field Mapper Detail
	{
		'checking_operator': '=',
		'doctype': 'Field Mapper Detail',
		'from_field': 'project_name',
		'map': 'Yes',
		'match_id': 0,
		'to_field': 'project_name'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'reserved_warehouse',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'warehouse'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'naming_series',
		'map': 'No',
		'match_id': 0,
		'to_field': 'naming_series'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'incentives',
		'map': 'No',
		'match_id': 3,
		'to_field': 'incentives'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_table': 'Sales Order',
		'match_id': 0,
		'to_table': 'Receivable Voucher',
		'validation_logic': 'docstatus=1'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'sales_order_detail',
		'from_table': 'Sales Order Detail',
		'match_id': 1,
		'to_field': 'entries',
		'to_table': 'RV Detail',
		'validation_logic': 'docstatus = 1'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'sales_order_detail',
		'from_table': 'Sales Order Detail',
		'match_id': 1,
		'to_field': 'entries',
		'to_table': 'RV Detail',
		'validation_logic': '(ifnull(amount, 0) = 0 or amount > ifnull(billed_amt, 0)) and docstatus = 1'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'other_charges',
		'from_table': 'RV Tax Detail',
		'match_id': 2,
		'to_field': 'other_charges',
		'to_table': 'RV Tax Detail',
		'validation_logic': 'name is not null'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'sales_team',
		'from_table': 'Sales Team',
		'match_id': 3,
		'to_field': 'sales_team',
		'to_table': 'Sales Team',
		'validation_logic': 'name is not null'
	}
]